1. Technical Field
The present subject matter relates to a method for shadow detection in a multiple colour channel image and to a traffic surveillance facility utilizing a method for shadow detection in a multiple colour channel image. The present subject matter may, for example, be advantageous in the field of computer vision, more specifically in the process of segmenting a foreground from a stationary background.
2. Background Art
Many image analysis applications, e.g. in traffic surveillance, include dividing an image into a foreground and a background. In traffic surveillance, the foreground is normally a passing vehicle that is to be detected, tracked or identified and the background, such as a roadway, is usually known. However, if a foreground object casts shadows on the background, these shadows are often incorrectly detected as part of the foreground object instead of as part of the background. Such incorrect segmentation of foreground and background may cause problems e.g. in the process of tracking vehicles.
A known method of detecting shadows in colour images is to define a shadow interval for each colour channel relative to the background, i.e. to define an interval of deviation from each background colour channel value corresponding to a shadowed background. Usually, the three dimensional hue-saturation-lightness (HSL) colour space is used, or sometimes the red-green-blue (RGB) colour space. The shadow intervals can be set manually or by an algorithm that calculates the most suitable interval values from a large number of test images in which regions manually have been marked as shadow or non-shadow. A region or pixel in the image is classified as shadow if each of its colour channel values falls within the defined shadow threshold of that colour channel.
However, even if the shadow intervals are thoroughly and very carefully selected, this approach does not result in perfect shadow detection—the box in three-dimensional colour space that results from the shadow interval defined in each colour channel does not correspond very well to the usually irregular, elongated worm-shape of the true shadow volume. Hence, the method of defining a shadow interval for each colour channel always leaves a trade-off between incorrectly classifying part of the foreground pixels as shadow and incorrectly classifying shadow as foreground. One solution could be to instead define and use a three-dimensional shadow volume in three-dimensional colour space, since a three-dimensional volume has the ability to provide an exact reflection of the true shadow volume. The three-dimensional shadow volume could be found by analysing a large number of test images where regions manually have been marked as shadow or non-shadow. However, storing the three-dimensional shadow volume would be a problem for today's computers—a three-dimensional lookup table with reasonable resolution would become extremely large, larger than what is manageable by today's standard computers. An alternative which requires less storage space than a three-dimensional lookup table is to store the shadow volume as a mathematical expression. However, mathematical descriptions such as spheres or ellipsoids cannot entirely reflect the typical irregular worm-shape of true shadow volumes and would hence lead to misclassifications.